package com.situ.stl.config;//package com.situ.stl.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    // 这里假设你上传的图片存储在本地的 D:/upload 目录下，根据实际情况修改
    private static final String UPLOAD_PATH = "file:D:/upload/";
    private static final String MAPPING_PATH = "/upload/";

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(MAPPING_PATH + "**")
                .addResourceLocations(UPLOAD_PATH);
    }
}
